package com.shalehe.joke.entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable
public class TextJoke {
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	@Persistent
	private String title;
	@Persistent
	private String content;
	@Persistent
	private Date created;
	@Persistent
	private String via;
	@Persistent
	private List<Comment> comments = new ArrayList<Comment>(0);
	
	public TextJoke() {
		super();
	}

	public TextJoke(Long id, String title, String content, Date created, String via) {
		super();
		this.id = id;
		this.title = title;
		this.content = content;
		this.created = created;
		this.via = via;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public String getVia() {
		return via;
	}

	public void setVia(String via) {
		this.via = via;
	}
	
	public List<Comment> getComments() {
		return comments;
	}

	public void setComments(List<Comment> comments) {
		this.comments = comments;
	}

	@Override
	public String toString() {
		return "TextJoke [comments=" + comments + ", content=" + content + ", created=" + created + ", id=" + id
				+ ", title=" + title + ", via=" + via + "]";
	}
	
}
